﻿@inject LayoutDataServices data
@{
    var tzList = data.getPostTitleList();
}

@*帖子,管理员可以设置置顶*@

<div class="aside-box">
    <div class="aside-title">
        <div class="col-md-6 text-left">
            <span style="cursor:pointer;" onclick="javascript: window.open('@Url.Action("list","post")')">查看全部帖子</span>
        </div>
        <div class="col-md-6 text-right">
            @if (Context.Session.Keys.Contains("LoginUser"))
            {
                <span style="cursor:pointer;" onclick="javascript: window.open('@Url.Action("add", "post")','_blank')">创建</span>
            }
        </div>
    </div>
    <div>
        <table class="table">
            @{
                if (tzList != null && tzList.Count > 0)
                {
                    foreach (var item in tzList)
                    {
                        <tr onclick="javascript: window.open('@Url.Action("detail","post",new { id = item.id })')">
                            <td>@item.nick_name</td>
                            <td>@item.title</td>
                            <td>@item.create_time.ToLocalTime().ToString("yyyy-MM-dd HH:mm")</td>
                        </tr>
                    }
                }
            }
        </table>
    </div>
</div>
